package com.zealcomm.ivcscustomer.service

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.zco.util.FragmentUtil
import com.zealcomm.ivcscustomer.R
import com.zealcomm.commonui.base.BaseFragment
import com.zealcomm.ivcscustomer.databinding.FragmentSubmitBaseInfoBinding
import com.zealcomm.ivcscustomer.fragment.CustomerBaseInfoFragment

class SubmitBaseInfoFragment : BaseFragment() {

    private var binding: FragmentSubmitBaseInfoBinding? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = FragmentSubmitBaseInfoBinding.inflate(inflater, container, false)
        return binding?.root
    }

    fun addFragment(fragment: Fragment?, step: Int) {
        FragmentUtil.addFragment(holdingActivity!! , fragment, R.id.fl_fragment_container)
        when (step) {
            1 -> {
                binding?.vStepAutoSubmit?.setBackgroundResource(R.color.login_btn_enable_color)
                binding?.cvNodeAutoSubmit?.setBackgroundResource(R.color.login_btn_enable_color)
            }
            2 -> {
                binding?.vStepAutoSubmit?.setBackgroundResource(R.color.login_btn_enable_color)
                binding?.cvNodeAutoSubmit?.setBackgroundResource(R.color.login_btn_enable_color)
                binding?.vStepVideoCustomer?.setBackgroundResource(R.color.login_btn_enable_color)
                binding?.cvNodeVideoCustomer?.setBackgroundResource(R.color.login_btn_enable_color)
            }
        }
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        FragmentUtil.showFragment(
            holdingActivity!!,
            CustomerBaseInfoFragment(),
            R.id.fl_fragment_container
        )
    }

    fun showVerifySuccess(show: Boolean) {
        binding?.llVerifySuccess?.visibility = if (show) {
            View.VISIBLE
        } else {
            View.GONE
        }
    }

    override fun initView(view: View?, savedInstanceState: Bundle?) {
    }


    override val layoutId: Int
        get() = R.layout.fragment_submit_base_info
}